﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

using System.Windows.Browser;
using eventr.View.Util;

namespace eventr.View
{
    public partial class ImageDetails : UserControl
    {
        public static readonly DependencyProperty SubImageMetadataProperty;

        public ImageDetails()
        {
            InitializeComponent();
            SetVisualState(false);
        }

        protected void SetVisualState(bool trans)
        {
            if (SubImageMetadata != null)
            {
                VisualStateManager.GoToState(this, "Displayed", trans);

            }
            else
            {
                VisualStateManager.GoToState(this, "Hidden", trans);
            }
        }


        public Model.AssetResult SubImageMetadata
        {
            get
            {
                return GetValue(SubImageMetadataProperty) as Model.AssetResult;
            }
            set
            {
                SetValue(SubImageMetadataProperty, value);
            }
        }


        static ImageDetails()
        {
            SubImageMetadataProperty = DependencyProperty.Register("SubImageMetadata", typeof(Model.AssetResult), typeof(ImageDetails), new PropertyMetadata(null, (s, e) =>
            {
                (s as ImageDetails).SetVisualState(true);
            }));
        }
    }
}